package BasicGrammar.Basic;

public class day_0921 {

    public static void main(String[] args) {
        int a = 1;

    }

    public static void main1(String[] args) {
        int[] a = {1,2,6,4,5};
        maopao(a);
        for(int x : a){
            System.out.print(x+" ");
        }
    }

 //冒泡排序
 public static void maopao(int[] a) {
     for (int k = 0; k < a.length - 1; k++) {

         boolean H = true;

         for (int l = 0; l < a.length - 1 - k; l++) {

             if (a[l] > a[l + 1]) {
                 int temp = a[l];
                 a[l] = a[l + 1];
                 a[l + 1] = temp;
                 H = false;
             }
         }

         if (H == true) {
             break;


         }
     }
    }




}
